Skip to content

Fix/webcam streamer resource leaks - #4

Merged
Hannott merged 3 commits into
developfrom
fix/webcam-streamer-resource-leaks
Jul 28, 2026
Merged

Fix/webcam streamer resource leaks#4
Hannott merged 3 commits into
developfrom
fix/webcam-streamer-resource-leaks

Conversation

@Hannott

@Hannott Hannott commented Jul 28, 2026

Copy link
Copy Markdown
Owner

Description

Related Tickets & Documents

Mobile & Desktop Screenshots/Recordings

[optional] Are there any post-deployment tasks we need to perform?

meteyou and others added 3 commits July 27, 2026 22:03
* fix(presets): fix edit/update preset function

Use deep clones to not store a reference to the formPreset.

* refactor(presets): refactor some code parts for better readability
The HLS and JMuxer streamers used `beforeUnmount()`, which is a Vue 3
lifecycle hook. This project runs Vue 2.7, where the hook is named
`beforeDestroy`, so neither `hls.destroy()` nor `jmuxer.destroy()` ever
ran. Every visit to a page showing one of these cameras left a decoder
and its network stream running for the rest of the session.

Hlsstreamer additionally called `play()` from `updated()`, tearing down
and rebuilding the entire Hls instance on every re-render. The `isVisible`
field — written by `v-observe-visibility` but never read — made this fire
whenever the video scrolled in or out of the viewport. Replace it with a
`@Watch('url')`, so the stream restarts only when its source actually
changes, and drop the now-unused visibility tracking.

JMuxerStream held its WebSocket in a local `const`, so nothing could
close it. Each `camSettings` change opened another socket while the old
one stayed open and kept feeding the newly created jmuxer. Keep the
socket on the instance, close it in `stop()`, and guard the handlers on
socket identity so a socket that is still closing cannot feed a newer
decoder.

Signed-off-by: Åsmund Collin <aakjaergaard@gmail.com>
@Hannott
Hannott merged commit fbc2592 into develop Jul 28, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants